<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="/script/jquery.min.js"></script>
    <script src="/script/zui/js/zui.min.js"></script>
    <link href="/script/zui/css/zui.min.css" rel="stylesheet">
    <script src="/script/zui/lib/bootbox/bootbox.css"></script>
    <script src="/script/zui/lib/bootbox/bootbox.min.js"></script>

</head>

<body>

    <button id="btn" class="btn btn-primary" type="button">主要按钮</button>
</body>

</html>
<script>
    bootbox.setDefaults("locale", "zh_cn");
    $(function () {

        $("#btn").click(function () {
            $.confirm("这是一个警告", function (rs) {
                if (rs) {
                    alert("你点击了确定");
                }
            });
        })
    })

    $.extend({

        alert: function (message, fun, opts) {
            opts = Object.assign({
                title: "提示",
                size: "small",
                message: message,
                callback: fun
            }, opts);
            bootbox.alert(opts);
        },
        confirm: function (message, fun, opts) {
            opts = Object.assign({
                title: "提示",
                size: "small",
                message: message,
                callback: fun
            }, opts);
            bootbox.confirm(opts);
        }
    })
</script>